package com.czk.model.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/5/10 14:54
 */
public class ObjectStructure {
    // 维护了一个集合
    private List<Person> list=new LinkedList<>();
    // 增加到list
    public void attach(Person person){
        list.add(person);
    }
    // 移除
    public void detach(Person person){
        list.remove(person);
    }
    // 显示测评情况
    public void showResult(Action action){
        for (Person person : list) {
            person.accpet(action);
        }
    }
}
